package com.business.lgh.naocs.naming.web;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author lgh
 * @version V1.0
 * @Package com.business.lgh.naocs.naming.web
 * @date 2020/6/28 8:18 下午
 */
@Configuration
public class NacosNamingConfig {

    @Bean
    public FilterRegistrationBean distroFilterRegistration() {
        FilterRegistrationBean<DistorFillter> registration = new FilterRegistrationBean<>();
        registration.setFilter(distorFillter());
        registration.addUrlPatterns("*");
        registration.setName("distroFilter");
        registration.setOrder(6);
        return registration;
    }

    @Bean
    public DistorFillter distorFillter(){
        return new DistorFillter();
    }

}
